﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;

/// <summary>
/// 单位表
/// </summary>
public class MdUnitMeasure : Entity<int>
{
    /// <summary>
    /// 单位编码
    /// </summary>
    [MaxLength(64)]
    [Required]
    public string MeasureCode { get; set; } = null!; // not null, max length 64

    /// <summary>
    /// 单位名称
    /// </summary>
    [MaxLength(255)]
    [Required]
    public string MeasureName { get; set; } = null!; // not null, max length 255

    /// <summary>
    /// 是否主单位
    /// Y：主单位；N：非主单位，需要设置对应的主单位以及换算比例
    /// </summary>
    [Required]
    public char PrimaryFlag { get; set; } = 'Y'; // not null, default 'Y'

    /// <summary>
    /// 主单位ID
    /// </summary>
    public long? PrimaryId { get; set; }

    /// <summary>
    /// 换算比例
    /// 与主单位之间的换算比例
    /// </summary>
    public double? ChangeRate { get; set; }

    /// <summary>
    /// 是否启用
    /// </summary>
    [Required]
    public char EnableFlag { get; set; } = 'Y'; // not null, default 'Y'

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(500)]
    public string? Remark { get; set; } // max length 500

    /// <summary>
    /// 创建人
    /// </summary>
    [MaxLength(64)]
    public string? CreateBy { get; set; } // max length 64

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime? CreateTime { get; set; }

    /// <summary>
    /// 更新人
    /// </summary>
    [MaxLength(64)]
    public string? UpdateBy { get; set; } // max length 64

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
}

